Repository navigation
fix(osd): speed up Super+P display-mode checkmarks - #1914
deepin-bot[bot] merged 1 commit into
Conversation
Reviewer's GuideImplementationTrack the default audio sink and update cached volume and mute state from D-Bus property changes so the audio OSD stays current.
Cache display-plan validity and refresh display state so repeated mode switches can advance through available plans and recover from failed list reads.
Replace the delayed hide callback with a managed timer and show each OSD request immediately without allowing an earlier hide to truncate it.
UIRoute matching repeat Super+P requests directly to the cached next display mode, while syncing state for other matching OSD requests.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="panels/notification/osd/audio/audioapplet.cpp" line_range="80" />
<code_context>
void AudioApplet::sync()
{
- setVolumeValue(fetchVolume());
+ if (const auto sinkPath = fetchDefaultSinkPath())
+ updateDefaultSink(*sinkPath);
+}
</code_context>
<issue_to_address>
**OSD shows stale output state**
When the DefaultSink read fails during an output switch or while an audio OSD request is being synced, `AudioApplet::sync()` leaves `m_sinkPath` and the displayed state unchanged; after an output switch, notifications from the new sink are ignored because their path does not match `m_sinkPath`, so the OSD shows stale output data.
Handle a failed `DefaultSink` read so the cached sink and displayed state cannot remain stale.
Also at `panels/notification/osd/audio/audioapplet.cpp:125`.
</issue_to_address>
### Comment 2
<location path="panels/notification/osd/audio/audioapplet.cpp" line_range="110" />
<code_context>
+ return;
+
+ if (m_sinkPath.isEmpty() || m_sinkPath == QStringLiteral("/")) {
+ m_muted.reset();
+ setVolumeValue(0.0);
+ return;
</code_context>
<issue_to_address>
**Transient reads corrupt audio OSD**
When an invalidated Mute or Volume property is re-read while the audio service returns a D-Bus error, `readSinkState` clears `m_muted` or stores `fetchVolume`’s `0.0` fallback instead of retaining the last valid value, so the visible OSD loses its icon or reports zero volume.
Keep the cached property value when its refresh fails, and update the OSD only with successfully read values.
Also at `panels/notification/osd/audio/audioapplet.cpp:114`.
</issue_to_address>
### Comment 3
<location path="panels/notification/osd/audio/audioapplet.cpp" line_range="128" />
<code_context>
+ return DDBusSender().service(audioService)
+ .path(audioPath)
+ .interface(audioService);
}
-static DDBusSender audioSinkInter()
</code_context>
<issue_to_address>
**Progress scale stays outdated**
When the audio service changes `IncreaseVolume` while the default sink stays the same, `onAudioPropertiesChanged()` returns without refreshing `m_increaseVolume`, so the visible OSD uses the old progress-bar scale and boost marks.
Handle `IncreaseVolume` changes in `onAudioPropertiesChanged()` even when the default sink does not change.
Also at `panels/notification/osd/audio/audioapplet.cpp:127`.
</issue_to_address>| void AudioApplet::sync() | ||
| { | ||
| setVolumeValue(fetchVolume()); | ||
| if (const auto sinkPath = fetchDefaultSinkPath()) |
There was a problem hiding this comment.
🟡 Medium · OSD shows stale output state
When the DefaultSink read fails during an output switch or while an audio OSD request is being synced, AudioApplet::sync() leaves m_sinkPath and the displayed state unchanged; after an output switch, notifications from the new sink are ignored because their path does not match m_sinkPath, so the OSD shows stale output data.
Handle a failed DefaultSink read so the cached sink and displayed state cannot remain stale.
Also at panels/notification/osd/audio/audioapplet.cpp:125.
Prompt for AI agents
In `panels/notification/osd/audio/audioapplet.cpp` at line 80:
**OSD shows stale output state**
When the DefaultSink read fails during an output switch or while an audio OSD request is being synced, `AudioApplet::sync()` leaves `m_sinkPath` and the displayed state unchanged; after an output switch, notifications from the new sink are ignored because their path does not match `m_sinkPath`, so the OSD shows stale output data.
Handle a failed `DefaultSink` read so the cached sink and displayed state cannot remain stale.
Also at `panels/notification/osd/audio/audioapplet.cpp:125`.| m_muted = qdbus_cast<bool>(reply); | ||
| } else { | ||
| qWarning() << "Failed to fetch Mute" << reply.error(); | ||
| m_muted.reset(); |
There was a problem hiding this comment.
🟡 Medium · Transient reads corrupt audio OSD
When an invalidated Mute or Volume property is re-read while the audio service returns a D-Bus error, readSinkState clears m_muted or stores fetchVolume’s 0.0 fallback instead of retaining the last valid value, so the visible OSD loses its icon or reports zero volume.
Keep the cached property value when its refresh fails, and update the OSD only with successfully read values.
Also at panels/notification/osd/audio/audioapplet.cpp:114.
Prompt for AI agents
In `panels/notification/osd/audio/audioapplet.cpp` at line 110:
**Transient reads corrupt audio OSD**
When an invalidated Mute or Volume property is re-read while the audio service returns a D-Bus error, `readSinkState` clears `m_muted` or stores `fetchVolume`’s `0.0` fallback instead of retaining the last valid value, so the visible OSD loses its icon or reports zero volume.
Keep the cached property value when its refresh fails, and update the OSD only with successfully read values.
Also at `panels/notification/osd/audio/audioapplet.cpp:114`.| sync(); | ||
| } | ||
| return; | ||
| } |
There was a problem hiding this comment.
🟡 Medium · Progress scale stays outdated
When the audio service changes IncreaseVolume while the default sink stays the same, onAudioPropertiesChanged() returns without refreshing m_increaseVolume, so the visible OSD uses the old progress-bar scale and boost marks.
Handle IncreaseVolume changes in onAudioPropertiesChanged() even when the default sink does not change.
Also at panels/notification/osd/audio/audioapplet.cpp:127.
Prompt for AI agents
In `panels/notification/osd/audio/audioapplet.cpp` at line 128:
**Progress scale stays outdated**
When the audio service changes `IncreaseVolume` while the default sink stays the same, `onAudioPropertiesChanged()` returns without refreshing `m_increaseVolume`, so the visible OSD uses the old progress-bar scale and boost marks.
Handle `IncreaseVolume` changes in `onAudioPropertiesChanged()` even when the default sink does not change.
Also at `panels/notification/osd/audio/audioapplet.cpp:127`.|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 52cyb, wjyrich The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
|
TAG Bot New tag: 6.2.2 |
|
TAG Bot New tag: 6.2.2 |
1. Dispatch OSD requests immediately by removing the fixed 100 ms delay. 2. Read display state on open. Advance the checkmark from the cached list on repeat presses and apply the final selection after two seconds. 3. Retry failed list reads. Start from the first item if the active mode or primary output is unknown. 4. Update audio OSD from Volume and Mute notifications. Refresh volume, mute and the volume boost setting when the default output changes. Log: Improve Super+P checkmark response and refresh audio OSD on changes Influence: 1. Verify the first Super+P press shows the active display mode. 2. Hold Super and tap P repeatedly. Verify the checkmark advances and only the final selection is applied after two seconds. 3. Verify recovery after a failed display list or mode read. 4. Test volume up from zero, mute and switching the default audio output while the OSD is visible. Check the progress bar and 100% mark. fix(osd): 加快 Super+P 切换显示模式时的勾选更新 1. 移除 OSD 固定的 100 ms 延时,收到请求后立即派发。 2. 首次打开读取显示状态,连按时用缓存列表推进勾选, 停按两秒后应用最后选中的模式。 3. 候选列表读取失败时重试,当前模式或主屏未知时从首项开始轮选。 4. 根据音量和静音通知补刷音量 OSD,默认输出切换时同时刷新 音量、静音和音量增强设置。 Influence: 1. 首按 Super+P,确认面板勾选当前模式。 2. 按住 Super 连按 P,确认勾选逐次推进,停按两秒只应用最后一项。 3. 验证候选列表或实际模式读取失败后仍能恢复轮选。 4. 验证音量从零回升、静音和面板可见时切换默认输出, 检查进度条和 100% 刻度是否正确。 Log: 加快 Super+P 勾选更新,并在音量状态变化后补刷面板 PMS: BUG-383567
a7bf793 to
44cc491
Compare
|
/forcemerge |
110e957
into
linuxdeepin:develop/2500u3
|
This pr force merged! (status: blocked, merge_method: rebase) |
Backport of #1849 (99a37db) to develop/2500u3.
Removes the fixed OSD dispatch delay, advances display-mode checkmarks on repeat Super+P presses, and refreshes the audio OSD from audio property changes.
PMS: BUG-383567
Summary by Sourcery
Make OSD updates more responsive and keep display-mode and audio indicators in sync with user actions and audio changes.
Bug Fixes: